$(function () {
    $("#transferVender").focus(function () {
        $.ajax({
            type:"get",
            url:"guohu_getOutUser.do",
            dataType:"json",
            success:function (data) {
                $("#table1").html('');
                $("#table1").append("<tr><td>客户id<td/>" +
                    "<td>客户名称<td/>" +
                    "<td>客户手机<td/>" +
                    "<td>客户电话<td/></tr>")
                for (var i=0;i<data.length;i++)
                {
                    $("#table1").append("<tr id='tr' onmouseout='change(this)' onmouseover='over(this)' onclick='dianJi1(\""+data[i].custId+"\",\""+data[i].custName+"\")' >" +
                        "<td>"+data[i].custId+"<td/>" +
                        "<td>"+data[i].custName+"<td/>" +
                        "<td>"+data[i].custIcChip+"<td/>" +
                        "<td>"+data[i].custTel+"<td/></tr>")
                }
            }
        })
    })



})
function dianJi1(custId,custName) {
    var want = custId+"-"+custName;
    //2 输入框的内容是你点击的div的内容
    $("#transferVender").val(want);
    //1 让下方table内容清空
    $("#table1").html("");
}
function over(tr) {
    tr.style.backgroundColor="hsl(176,45%,43%)"
}
function change(tr) {
    tr.style.backgroundColor="white"
}

